<?php

/**
 * @author Laurent SITTLER <lolo.sittler@gmail.com>
 * @author Alexandre GOMEZ <gomez.alexandre02@gmail.com>
 * @version 0.1
 */

/**
 * Session Class
 */
class Session {

    /**
     * Create session
     */
    function __construct() {
        
    }

    /**
     * Init session start
     */
    public static function Init() {
        @session_start();
    }

    /**
     * Set value in session
     * @param String $key
     * @param String $value
     */
    public static function Set($key, $value) {
        $_SESSION[$key] = $value;
    }

    /**
     * Get value in session
     * @param String $key
     * @return String Value
     */
    public static function Get($key) {
        if (isset($_SESSION[$key]))
            return $_SESSION[$key];
        else
            return null;
    }

    /**
     * Destroy specific session or all sessions
     * @param String $ConstantSession
     */
    public static function Destroy() {
        if (func_num_args() == 0) {
            unset($_SESSION);
            session_destroy();
        } else {
            unset($_SESSION[func_get_arg(0)]);
        }
    }

}